import requests
from lxml import etree
url = 'http://www.baidu.com'
head = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36'}
r = requests.get(url=url,headers=head)
r.encoding = r.apparent_encoding
neir = r.text

html_tree = etree.HTML(neir)
doc = html_tree.xpath('//input[@id="su"]/@value')[0]
print(doc)